package com.huawei.appgallery.forum.search.card;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.forum.base.card.ForumNode;
import com.huawei.appgallery.foundation.ui.framework.widget.Space;
import o.bzw.a;
import o.bzw.b;
import o.bzw.e;
import o.cih;

public class ForumSearchPostNode extends ForumNode {
    public ForumSearchPostNode(Context context) {
        super(context);
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        LinearLayout linearLayout = (LinearLayout) from.inflate(e.ˊ, null);
        LinearLayout linearLayout2 = (LinearLayout) linearLayout.findViewById(a.ˏ);
        int ˏ = ˏ();
        LayoutParams layoutParams = new LinearLayout.LayoutParams(this.ॱ.getResources().getDimensionPixelSize(b.ˋ), -1);
        for (int i = 0; i < ˏ; i++) {
            View inflate = from.inflate(e.ˎ, null);
            cih ˏ2 = ˏ(this.ॱ);
            ˏ2.ˏ(inflate);
            ˊ(ˏ2);
            linearLayout2.addView(inflate);
            if (i < ˏ - 1) {
                linearLayout2.addView(new Space(this.ॱ), layoutParams);
            }
        }
        viewGroup.addView(linearLayout);
        return true;
    }

    private ForumSearchPostCard ˏ(Context context) {
        return new ForumSearchPostCard(context);
    }
}
